﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
namespace dzs.Web.role_right
{
    public partial class Add : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
                       
        }

        		protected void btnSave_Click(object sender, EventArgs e)
		{
			
			string strErr="";
			if(!PageValidate.IsNumber(txtroles_id.Text))
			{
				strErr+="roles_id格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtrights_id.Text))
			{
				strErr+="rights_id格式错误！\\n";	
			}

			if(strErr!="")
			{
				MessageBox.Show(this,strErr);
				return;
			}
			int roles_id=int.Parse(this.txtroles_id.Text);
			int rights_id=int.Parse(this.txtrights_id.Text);

			dzs.Model.role_right model=new dzs.Model.role_right();
			model.roles_id=roles_id;
			model.rights_id=rights_id;

			dzs.BLL.role_right bll=new dzs.BLL.role_right();
			bll.Add(model);
			Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功！","Add.aspx");

		}


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}
